<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>

<%@page import="com.lovo.bbs.vo.*,com.lovo.bbs.bo.*,java.util.*"%>

<%
	String asUsername = (String) request.getParameter("username");
	String username=null;
	//用户名
	if (asUsername != null) {
		username = new String(asUsername.getBytes("ISO-8859-1"),
				"utf-8");
	}
	UserInfoVo userData = new UserInfoBo().getUserInfo(username,UserInfoBo.TYPE_OF_MEMBER);

	//操作类型
	String asOpType = (String) request.getParameter("opType");
	int opType = 0;
	if (!"".equals(asOpType) && asOpType != null) {
		opType = Integer.parseInt(asOpType);
	}

	 //请求页
	String queryPages = (String)request.getParameter("queryPage");
	if(queryPages==null||"".equals(queryPages)||"0".equals(queryPages)){
	  queryPages="1";
	}
	int queryPage=Integer.parseInt(queryPages);
	
	String processMod[] = { "增加用户", "修改用户", "删除用户" };
	Iterator it;
%>
<html>
	<head>
		<link href="../../../css/admin.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="../../../js/wbs_admin.js"></script>
		
		<script type="text/javascript">
		 function validate(){
      	 
       	   var msg=document.getElementById("errormsg");
       	   
       	   if(!isZore(document.frmMain.postnum.value)){            
              msg.innerHTML="<br><font color='red'>提示:请正确填写发表次数</font>"    
              document.frmMain.postnum.focus();
              return false;
           }
           
		   if(!isEmail(document.frmMain.email.value)){
              msg.innerHTML="<br><font color='red'>提示:请正确填写Email</font>";
              document.frmMain.email.focus();
              return false;
           }
           
           if(!isZore(document.frmMain.credits.value)){            
              msg.innerHTML="<br><font color='red'>提示:请正确填写积分</font>"    
              document.frmMain.credits.focus();
              return false;
           }
         return true;  
        }
		</script>
	</head>
	<body >
		<form name="frmMain" action="UserUpdateServlet" method="post"
			onSubmit="return validate();">
			<table class="navigation" style="width: 98%" align="center">
				<tr>
					<td>
						当前位置: 用户管理-->操作-->
						<font color="red"><%=processMod[opType - 1]%></font>
					</td>
				</tr>
			</table>
			<table style="width: 90%;" align="center">
				<div class="DialogBody">
					<div class="formArea">
						<div id="errormsg" class="DialogMsg"></div>
						<p>
							&nbsp;用户名:
							<input type="text" name="username" style="width: 200px"
								value="<%=userData.getUserName()%>" disabled="disabled">
						<p>
						    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							发表数:
							<input type="text" name="postnum" style="width:200px" maxlength="9" 
							value="<%=userData.getTopicNum()%>">(1~9个数字)&nbsp;&nbsp;
						<p>
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							Email:
							<input type="text" name="email" style="width: 200px"
								maxlength="50" value="<%=userData.getEmail()%>">
							(1~50字符)&nbsp;
						<p>
						   &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							&nbsp;积分:
							<input type="text" name="credits" style="width: 200px"
								maxlength="9" value="<%=userData.getScore()%>">
							(1~9个数字)
						<p>
						<p>
							<input type="submit" name="submit" class="button" value=" 确定 "
								onclick="validate();">
							<input type="button" name="button" class="button" value=" 取消 "
								onclick="preReturn();">
						<p>
							<br>
					</div>
				</div>
			</table>
			
			<input type="hidden" name="userid" value="<%=userData.getUserId()%>">
			
			<input type="hidden" name="opType" value="<%=opType%>">
			
			<input type="hidden" name="queryPage" value="<%=queryPage%>">
			
	</body>
</html>
